package com.hengpeng.itfinbase.persist;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputPattern;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.idAssign.AbstractAssign18IdEntity;

/**
 * <pre>
 * 还款计划表
 * </pre>
 * @author chenhui
 * @version 1.0, 2015-5-18
 */
@Entity
public class RepaymentPlan extends AbstractAssign18IdEntity implements Cloneable, Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -2504636217562977187L;

	/**
	 * 借款信息id
	 */
	@HtmlInput(index = 1, type = HtmlInputType.TEXT, label = "借款信息编号", nullable = false)
	private Long borrowInfoId;

	/**
	 * 标的名称
	 */
	@Column(length = 50)
	@HtmlInput(index = 2, type = HtmlInputType.TEXT, label = "标的名称", nullable = false)
	private String borrowName;

	/**
	 * 应还金额(单位：分)
	 */
	@HtmlInput(index = 3, type = HtmlInputType.TEXT, label = "应还金额(分)", nullable = false)
	private Long repayMoney;

	/**
	 * 应还本金(单位：分)
	 */
	@HtmlInput(index = 4, type = HtmlInputType.TEXT, label = "应还本金(分)", nullable = false)
	private Long repayBaseMoney;

	/**
	 * 应还利息 (单位：分)
	 */
	@HtmlInput(index = 5, type = HtmlInputType.TEXT, label = "应还利息(分)", nullable = false)
	private Long repayInterestMoney;

	/**
	 * 附加利息
	 */
	@HtmlInput(index = 16, type = HtmlInputType.TEXT, label = "附加利息(分)", nullable = false)
	private Long repayAddMoney;

	/**
	 * 借款人用户名
	 */
	@Column(length = 50)
	@HtmlInput(index = 6, type = HtmlInputType.TEXT, label = "借款人", nullable = false)
	private String borrowUserName;

	/**
	 * 总还款期数
	 */
	@HtmlInput(index = 7, type = HtmlInputType.TEXT, label = "总期数", nullable = false)
	private Integer totalRepayNum;

	/**
	 * 当前期数
	 */
	@HtmlInput(index = 8, type = HtmlInputType.TEXT, label = "当前期数", nullable = false)
	private Integer curRepayNum;

	/**
	 * 截止还款日
	 */
	@HtmlInput(index = 9, type = HtmlInputType.TEXT, label = "截止还款日", pattern = HtmlInputPattern.DATE, format = "yyyy-MM-dd", nullable = false)
	private Date lastRepayDate;

	/**
	 * 逾期罚息金额(单位：分)
	 */
	@HtmlInput(index = 10, type = HtmlInputType.TEXT, label = "逾期罚息(分)", nullable = false)
	private Long overduePenalty;

	/**
	 * 逾期起息日
	 */
	@HtmlInput(index = 11, type = HtmlInputType.TEXT, label = "逾期起息日", pattern = HtmlInputPattern.DATE, format = "yyyy-MM-dd", nullable = false)
	private Date overdueDate;

	/**
	 * 还款状态
	 */
	@Column(length = 20)
	@HtmlInput(index = 12, type = HtmlInputType.TEXT, label = "状态", labelProperty = "text", nullable = false)
	@Enumerated(javax.persistence.EnumType.STRING)
	private ReplaymentStatus status;

	/**
	 * 还款时间
	 */
	@HtmlInput(index = 13, type = HtmlInputType.TEXT, label = "实际还款时间", nullable = false)
	private Date repayTime;

	/**
	 * 还款类型
	 */
	@Column(length = 10)
	@HtmlInput(index = 14, type = HtmlInputType.TEXT, label = "还款类型", nullable = false)
	@Enumerated(javax.persistence.EnumType.STRING)
	private ReplaymentType type;

	/**
	 * 借款人id
	 */
	@Column(length = 51)
	@HtmlInput(index = 15, type = HtmlInputType.TEXT, label = "借款人id", nullable = false)
	private Long borrowUserId;

	/**
	 * 最后更新时间
	 */
	@HtmlInput(index = 16, type = HtmlInputType.TEXT, label = "最后更新时间", nullable = false)
	private Date updateTime;

	/**
	 * 创建时间
	 */
	@HtmlInput(index = 17, type = HtmlInputType.TEXT, label = "创建时间", nullable = false)
	private Date createTime;

	/**
	 * 是否逾期
	 */
	@HtmlInput(index = 15, type = HtmlInputType.TEXT, label = "是否逾期", nullable = false)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue isOverDured;

	public Long getRepayAddMoney()
	{
		return repayAddMoney;
	}

	public void setRepayAddMoney(Long repayAddMoney)
	{
		this.repayAddMoney = repayAddMoney;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public BoolValue getIsOverDured()
	{
		return isOverDured;
	}

	public void setIsOverDured(BoolValue isOverDured)
	{
		this.isOverDured = isOverDured;
	}

	public String getBorrowUserName()
	{
		return borrowUserName;
	}

	public void setBorrowUserName(String borrowUserName)
	{
		this.borrowUserName = borrowUserName;
	}

	public ReplaymentType getType()
	{
		return type;
	}

	public void setType(ReplaymentType type)
	{
		this.type = type;
	}

	public Date getRepayTime()
	{
		return repayTime;
	}

	public void setRepayTime(Date repayTime)
	{
		this.repayTime = repayTime;
	}

	public ReplaymentStatus getStatus()
	{
		return status;
	}

	public void setStatus(ReplaymentStatus status)
	{
		this.status = status;
	}

	public Long getRepayMoney()
	{
		return repayMoney;
	}

	public void setRepayMoney(Long repayMoney)
	{
		this.repayMoney = repayMoney;
	}

	public Long getRepayBaseMoney()
	{
		return repayBaseMoney;
	}

	public void setRepayBaseMoney(Long repayBaseMoney)
	{
		this.repayBaseMoney = repayBaseMoney;
	}

	public Long getRepayInterestMoney()
	{
		return repayInterestMoney;
	}

	public void setRepayInterestMoney(Long repayInterestMoney)
	{
		this.repayInterestMoney = repayInterestMoney;
	}

	public Long getOverduePenalty()
	{
		return overduePenalty;
	}

	public void setOverduePenalty(Long overduePenalty)
	{
		this.overduePenalty = overduePenalty;
	}

	public Date getOverdueDate()
	{
		return overdueDate;
	}

	public void setOverdueDate(Date overdueDate)
	{
		this.overdueDate = overdueDate;
	}

	public Long getBorrowInfoId()
	{
		return borrowInfoId;
	}

	public void setBorrowInfoId(Long borrowInfoId)
	{
		this.borrowInfoId = borrowInfoId;
	}

	public String getBorrowName()
	{
		return borrowName;
	}

	public void setBorrowName(String borrowName)
	{
		this.borrowName = borrowName;
	}

	public Integer getTotalRepayNum()
	{
		return totalRepayNum;
	}

	public void setTotalRepayNum(Integer totalRepayNum)
	{
		this.totalRepayNum = totalRepayNum;
	}

	public Integer getCurRepayNum()
	{
		return curRepayNum;
	}

	public void setCurRepayNum(Integer curRepayNum)
	{
		this.curRepayNum = curRepayNum;
	}

	public Date getLastRepayDate()
	{
		return lastRepayDate;
	}

	public void setLastRepayDate(Date lastRepayDate)
	{
		this.lastRepayDate = lastRepayDate;
	}

	public Long getBorrowUserId()
	{
		return borrowUserId;
	}

	public void setBorrowUserId(Long borrowUserId)
	{
		this.borrowUserId = borrowUserId;
	}

	/**
	 * <pre>
	 * 还款状态
	 * </pre>
	 * @author chenhui
	 * @version 1.0, 2015-5-15
	 */
	public static enum ReplaymentStatus
	{
		/**
		 * 待还款
		 */
		UNSETTLE("待还款"),
		/**
		 * 还款中
		 */
		SETTLING("还款中"),
		/**
		 * 已还清
		 */
		REPAYMENTED("已还清");

		private String text;

		ReplaymentStatus(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	/**
	 * <pre>
	 * 还款类型
	 * </pre>
	 * @author chenhui
	 * @version 1.0, 2015-5-15
	 */
	public static enum ReplaymentType
	{
		/**
		 * 借款人正常还款
		 */
		NORMAL("正常还款"),

		/**
		 * 平台垫付
		 */
		ADVANCE("平台垫付");

		private String text;

		ReplaymentType(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}
}
